import request from "../utils/request";

//商品列表
const getGoodsList = (queryInfo)=>{
    return request.get('/api/admin/goods',{params:{current:queryInfo.current,title:queryInfo.title,category_id:queryInfo.category_id,is_on:queryInfo.is_on,is_recommend:queryInfo.is_recommend}})
}

// 商品上下架

const goodsUpDown = (id)=>{
    return request.patch(`/api/admin/goods/${id}/on`)
}

// 商品推荐
const goodsRecommend = (id)=>{
    return request.patch(`/api/admin/goods/${id}/recommend`)
}
export {
    getGoodsList,
    goodsUpDown,
    goodsRecommend
}